// 统一请求路径前缀在libs/axios.js中修改
import { getRequest, postRequest, putRequest, deleteRequest } from '@/libs/axios';

//获取字典列表数据
export const getDict = () => {
  return getRequest(`/sysDict/all-children`)
}
//字典添加
export const saveDict = (params) => {
  return postRequest('/sysDict/add', params)
}

//字典二级添加
export const saveerDict = (params) => {
  return postRequest('/sysDictItem/add', params)
}

//删除字典
export const delDict = (id) => {  
  return deleteRequest(`/sysDict/del/${id}`)
}

//删除二级字典
export const delerDict = (id) => {  
  return deleteRequest(`/sysDictItem/${id}`)
}
//修改字典
export const updateDict = (params, id) => {
  return putRequest(`/sysDict/update/${id}`, params)
}

//修改二级字典
export const updateerDict = (params, id) => {
  return putRequest(`/sysDictItem/update/${id}`, params)
}

//获取字典列表数据
export const getDictByCode = (dictCode) => {
  return getRequest(`/dictionary/getDict/${dictCode}`)
}